package com.mall.controller;

import com.domain.Buns;
import com.domain.result.ResultData;
import com.service.seinterface.BunsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@RestController
@RequestMapping("/mall")
public class BunsConstroller {

    @Autowired
    BunsService bunsService;


    @RequestMapping("/addBuns")
    public ResultData addBuns(Buns buns,MultipartFile file){

        return bunsService.addBuns(buns,file);
    }


    @RequestMapping("/deleteBunsById")
    public ResultData deleteBunsById(Integer bunsid){
        return bunsService.deleteBunsById(bunsid);
    }


    @RequestMapping("/updateBunsById")
    public ResultData updateBunsById(Buns buns,MultipartFile file){
        return bunsService.updateBunsById(buns,file);
    }

    @RequestMapping("/selectBunsAll")
    public ResultData selectBunsAll(){
        return bunsService.selectBunsAll();
    }

    @RequestMapping("/deleteBunsByIds")
    public ResultData deleteBunsByIds(@RequestBody List<Integer> list){
        return  bunsService.deleteBunsByIds(list);
    }

}
